#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;

const int N = 2e5 + 10;

int n;
pll a[N];

int main() {
    cin >> n;
    for(int i = 1; i <=n ; i++) {
        ll l, r;
        cin >> l >> r;
        a[i] = {l, r};
    }
    ll ans = 0;

    ll maxl = a[1].first, minr = a[1].second;

    cout << 0 << endl;
    for (int i = 2; i <= n; i++) {
        ll cur_l = a[i].first, cur_r = a[i].second;
        maxl = max(maxl, cur_l);
        minr = min(minr, cur_r);

        if (minr > maxl) cout << 0 << endl;
        else cout << (maxl - minr + 1)/2 << endl;
    }
    return 0;
}